package cn.com.shinho.hg.core.log.entity;

import javax.persistence.Column;
import javax.persistence.Id;

/**
 * @program: hg-server-parent
 * @description: ${description}
 * @author: Mr.Ye
 * @create: 2018-08-07
 **/
public class HGTraceLog {


    private static final long serialVersionUID = 1L;

    @Id
    private Long id;
    /**
     * 应用名称
     */
    @Column(name="APPLICATION_NAME")
    private String applicationName;
    /**
     * 方法名称
     */
    @Column(name="METHOD_NAME")
    private String methodName;
    /**
     * 请求路径
     */
    @Column(name="SERVLET_PATH")
    private String servletPath;
    /**
     * rpc调用类型，
     G1,     //网关发送请求

     G2,     //接收网关请求（切controller）

     P1,     //调用端发送请求（切consumer）

     P2,     //被调用端接收到请求（切provider）

     P3,     //被调用端发送响应成功

     P4,     //调用端接收到响应成功

     EP3,    //被调用端发送响应失败

     EP4,    //调用端接收到响应失败

     G3,     //控制器响应网关成功

     G4,     //网关接收到成功请求

     EG3,    //控制器接收到错误响应

     EG4,    //网关接收到错误响应
     */
    @Column(name="RPC_PHASE")
    private String rpcPhase;
    /**
     * 唯一请求号
     */
    @Column(name="TRACE_ID")
    private String traceId;
    /**
     * 节点id
     */
    @Column(name="SPAN_ID")
    private String spanId;
    /**
     * 节点父id
     */
    @Column(name="PARENT_SPAN_ID")
    private String parentSpanId;
    /**
     * 生成时间戳
     */
    @Column(name="CREATE_TIME")
    private Long createTime;
    /**
     * 日志内容
     */
    @Column(name="CONTENT")
    private String content;
    /**
     * ip地址
     */
    @Column(name="IP")
    private String ip;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getApplicationName() {
        return applicationName;
    }

    public void setApplicationName(String applicationName) {
        this.applicationName = applicationName;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String getServletPath() {
        return servletPath;
    }

    public void setServletPath(String servletPath) {
        this.servletPath = servletPath;
    }

    public String getRpcPhase() {
        return rpcPhase;
    }

    public void setRpcPhase(String rpcPhase) {
        this.rpcPhase = rpcPhase;
    }

    public String getTraceId() {
        return traceId;
    }

    public void setTraceId(String traceId) {
        this.traceId = traceId;
    }

    public String getSpanId() {
        return spanId;
    }

    public void setSpanId(String spanId) {
        this.spanId = spanId;
    }

    public String getParentSpanId() {
        return parentSpanId;
    }

    public void setParentSpanId(String parentSpanId) {
        this.parentSpanId = parentSpanId;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    @Override
    public String toString() {
        return "HGTraceLog{" +
                "id=" + id +
                ", applicationName=" + applicationName +
                ", methodName=" + methodName +
                ", servletPath=" + servletPath +
                ", rpcPhase=" + rpcPhase +
                ", traceId=" + traceId +
                ", spanId=" + spanId +
                ", parentSpanId=" + parentSpanId +
                ", createTime=" + createTime +
                ", content=" + content +
                ", ip=" + ip +
                "}";
    }
}
